package com.hzcx.app.simplechat.ui.chat.bean;

import com.hzcx.app.simplechat.ui.group.bean.GroupInfoBean;
import com.hzcx.app.simplechat.ui.user.bean.UserInfoBean;

public class ChatInfoAdapterBean {
    public UserInfoBean userInfoBean;
    public GroupInfoBean groupInfoBean;

    // 是否被删除
    public boolean isDel() {
        return userInfoBean != null && userInfoBean.getIs_del() == 1;
    }

    public void setIs_del(int is_del) {
        if (userInfoBean != null) {
            userInfoBean.setIs_del(is_del);
        }
    }

    // 是否是助手
    public boolean isAssistant() {
        return userInfoBean != null && userInfoBean.getIs_assistant() == 1;
    }

    // 是否是服务消息
    public boolean isService() {
        return userInfoBean != null && userInfoBean.getIs_service() == 1;
    }

    // 获取会员id
    public int getMember_id() {
        if (userInfoBean != null) {
            return userInfoBean.getMember_id();
        }
        return groupInfoBean.getMember_id();
    }

    public ChatInfoAdapterBean(UserInfoBean userInfoBean) {
        this.userInfoBean = userInfoBean;
    }

    public ChatInfoAdapterBean(GroupInfoBean groupInfoBean) {
        this.groupInfoBean = groupInfoBean;
    }
}
